home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 154
/
154.d81
/
knights ex
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
6KB
|
170 lines
10 poke53280,0:poke53281,10:poke646,0:poke53272,31
12 dv=peek(186):ifdv<8thendv=8
20 :
30 rem title screen
40 :
50 print"[147][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223]";
60 print"[223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][146]";
70 print"[169][223] [169][223]";
80 print"[223][169][146] [176][176][174][176][174][174][178][176][192][174][176] [174][176][178][174][176][192][174][174] [169][223][146]";
90 print"[169][223] [221][221] [221][221][221][221][221] [221] [221] [221] [221] [169][223]";
100 print"[223][169][146] [171][177][174][221][221][221][221][221] [174][171][192][179] [221] [173][192][174] [223][169][146]";
110 print"[169][223] [221] [221][221][221][221][221][221] [221][221] [221] [221] [221] [169][223]";
120 print"[223][169][146] [173] [189][173][173][189][177][173][192][189][173] [189] [177] [173][192][189] [223][169][146]";
130 print"[169][223] [176][192][174][176][174][176][176][192][174][176] [174][176][192][174][176][174][174][176][192][174][176][192][174] [169][223]";
140 print"[223][169][146] [221] [221][221][221] [221] [221][221] [221][221][221][221][221] [221] [223][169][146]";
150 print"[169][223] [171][192] [176][219][189][221] [171][192][179][171][192][179][221][221][221][221] [174][171][192] [169][223]";
160 print"[223][169][146] [221] [221][221] [221] [221] [221][221] [221][221][221][221][221] [221][221] [223][169][146]";
170 print"[169][223] [173][192][189][189][173][189][173][192][189][173] [189][173] [189][173][173][189][173][192][189][173][192][189] [169][223]";
180 print"[223][169][146] [176][192][192][174][176] [174][176][192][192][174][176][192][192][174][176][192][192][174] [223][169][146]";
190 print"[169][223] [221] [171][192][192][179][171][192] [173][192][192][174][173][192][192][174] [169][223]";
200 print"[223][169][146] [173][192][192][189][173] [189][173][192][192][189][173][192][192][189][173][192][192][189] [223][169][146]";
210 print"[169][223] [176][192][174][176] [174][176][192][174][176][192][174][176] [176][192][174] [169][223]";
220 print"[223][169][146] [171][192][189][221] [221][176][192][189][176][192][189][221] [171][192] [223][169][146]";
230 print"[169][223] [173] [173][192][189][173][192][189][173][192][189][173][192][189][173][192][189] [169][223]";
240 print"[223][169][146] [223][169][146]";
250 print"[169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223]";
260 print"[223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169][223][169]";
270 fori=1to2:print" [146]";:next
280 print" [157][148] "
290 tq=0:poke53370,0
292 tq=tq+1:geta$:ifa$=""andtq<200then292
294 poke53371,0
298 gosub1290
300 :
310 rem instruction screen
320 :
330 dv=peek(186):ifdv<8thendv=8
332 poke53281,10:poke53280,0:s=53248
334 print"[147][144] [212]o begin, two white knights occupy the"
340 print" upper corners while two black knights"
350 print" occupy the lower corners of a three by"
360 print" three square gameboard grid."
370 print" [176][192][192][192][192][178][192][192][192][192][178][192][192][192][192][174]"
380 fori=1to3:print" [221] [221] [221] [221]":next
390 print" [171][192][192][192][192][219][192][192][192][192][219][192][192][192][192][179]"
400 fori=1to3:print" [221] [221] [221] [221]":next
410 print" [171][192][192][192][192][219][192][192][192][192][219][192][192][192][192][179]"
420 fori=1to3:print" [221] [221] [221] [221]":next
430 print" [173][192][192][192][192][177][192][192][192][192][177][192][192][192][192][189]"
440 print" [212]he objective is to end the game with"
450 print" the corner positions of the white and"
460 print" black knights exchanged[144] using only the"
470 print" nine cells and the knight's chess move.";
480 pokes+2,132:pokes+3,100:pokes+4,212:pokes+5,100
490 pokes+6,132:pokes+7,164:pokes+8,212:pokes+9,164
500 pokes+21,30:print" [208]ress any key to begin.";
510 geta$:ifa$=""then510
512 pokes+21,0
520 :
530 rem gameboard screen
540 :
550 print"[147]";:poke53281,0:poke53280,10:poke646,10
560 print" [146] [198][210][207][205] [212][207] [198][210][207][205] [212][207]"
570 print" [150] [176][192][192][192][192][178][192][192][192][192][178][192][192][192][192][174] [146]"
580 print" [150] [221]1 [150][146][221]2 [150][146][221]3 [150][146][221][146] [146]"
590 fori=1to2: print" [150] [221] [150][146][221] [150][146][221] [150][146][221] [146]":next
600 print" [150] [171][192][192][192][192][219][192][192][192][192][219][192][192][192][192][179] [146]"
610 print" [150] [221]4 [150][146][221]5 [150][146][221]6 [150][146][221] [146]"
620 fori=1to2: print" [150] [221] [150][146][221] [150][146][221] [150][146][221] [146]":next
630 print" [150] [171][192][192][192][192][219][192][192][192][192][219][192][192][192][192][179] [146]"
640 print" [150] [221]7 [150][146][221]8 [150][146][221]9 [150][146][221] [146]"
650 fori=1to2: print" [150] [221] [150][146][221] [150][146][221] [150][146][221] [146]":next
660 print" [150] [173][192][192][192][192][177][192][192][192][192][177][192][192][192][192][189] [146]"
670 print" [146]"
680 fori=1to2:print" [146]":next
690 fori=1to6:print" [146]":next
700 print" [146]";
710 print" [157][148] "
712 poke214,15:print:print"[150] [208]ress [209] to [209]uit
720 :
730 [143] sprite positioning
740 :
750 s[178]53248:[151]s[170]2,52:[151]s[170]3,68:[151]s[170]4,132:[151]s[170]5,68
760 [151]s[170]6,52:[151]s[170]7,132:[151]s[170]8,132:[151]s[170]9,132
770 [151]s[170]21,30
780 :
790 [143] set variables
800 :
810 [134] t(16),f(16):m[178]1:mp[178]1088:s$[178]" "
820 [129]i[178]1[164]16:[135]n:f(i)[178][181](n[173]10):t(i)[178]n[171]10[172]f(i):[130]
830 p[178]1747:[141]1140:[153]"cont(NULL)ove (NULL)umber:"
840 p[178]1984:[141]1140:[153]"def chr$oal: peek(NULL)atnlen(NULL) on (NULL)op (NULL)left$right$(NULL)val at peekottom"
850 [129]i[178]1[164]9:c(i)[178]0:[130]:c(1)[178]1:c(3)[178]2:c(7)[178]3:c(9)[178]4
860 [129]i[178]1[164]7[169]3:x(i)[178]52:x(i[170]1)[178]92:x(i[170]2)[178]132:[130]
870 [129]i[178]1[164]3:y(i)[178]68:y(i[170]3)[178]100:y(i[170]6)[178]132:[130]
880 :
890 [143] input move
900 :
910 p[178]1759:[141]1140:[153]""m
920 [151]198,0:p[178]1784:[141]1140:[153]s$;:p[178]1824:[141]1140:[153]s$;
930 p[178]1788:[141]1140:[153]"cont(NULL)ove ascrom: cmd";:[141]1210:f$[178]g$
940 f[178][197](f$):[139]f[179]1[176]f[177]9[167]1010
950 [151]198,0:p[178]1824:[141]1140:[153]s$;
960 p[178]1829:[141]1140:[153]"cont(NULL)ove (NULL)o: cmd";:[141]1210:t$[178]g$
970 t[178][197](t$):[139]t[179]1[176]t[177]9[167]1010
980 [139]c(f)[178]0[176]c(t)[179][177]0[167]1010
990 [129]i[178]1[164]16:[139]f[178]f(i)[175]t[178]t(i)[167]1030
1000 [130]i
1010 p[178]1864:[141]1140:[153]" (NULL)ove (NULL)ot (NULL)ossible!";:[129]i[178]1[164]2000:[130]
1020 [141]1140:[153]s$;:[137]920
1030 p[178]mp:[141]1140:[153]f" "t:m[178]m[170]1:mp[178]mp[170]40:[139]